package top.kuxiao.crmserver.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import top.kuxiao.crmserver.pojo.SysUser;
import top.kuxiao.crmserver.service.ISysUserService;
import top.kuxiao.crmserver.utils.Auth;
import top.kuxiao.crmserver.utils.ResultUtil;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author kuxiao
 * @since 2022-01-17
 */
@RestController
@RequestMapping("/sys-user")
@CrossOrigin
public class SysUserController {
    @Autowired
    ISysUserService service;

    @Auth("SE,AM")
    @RequestMapping(value = "/list/{name}",method = RequestMethod.POST)
    public ResultUtil queryAll(@PathVariable String name){
        SysUser sysUser = new SysUser();
        sysUser.setName(name);
        return ResultUtil.resObj(service.list(new QueryWrapper<>(sysUser)));
    }

}
